In the past, when a dense disparity image is generated, an algorithm (a semi-global matching (SGM) technique) of searching for corresponding (matching) points between two images, generating a disparity image, and then optimizing a disparity value in view of smoothness with neighboring disparities (in 8 to 16 directions) has been used.
For example, the following technique is used in a dense disparity image generating technique disclosed in Patent Literature 1. A brightness image L and a brightness image R are acquired from left and right cameras of a stereo camera. A disparity image D(1) based on the brightness image L is generated based on both the acquired brightness image L and the brightness image R, and a disparity image D′(1′) based on the brightness image R is generated based on both the brightness image L and the brightness image R. An image C(1) (and an image S(1)) is generated by correcting disparity values of pixels configuring the generated disparity image D(1) based on disparity values of some pixels in (i) a left pixel route, (ii) an upper-left oblique pixel route, (iii) an upper pixel route, and (iv) an upper-right oblique pixel route with respect to the same pixel (hereinafter, referred to as a “correction process A”). An image C′(1′) (and an image S′(1′)) is generated by correcting disparity values of pixels configuring the generated disparity image D′(1′) based on disparity values of some pixels in (v) a right pixel route, (vi) a lower-right oblique pixel route, (vii) a lower pixel route, and (viii) a lower-left oblique pixel route with respect to the same pixel (hereinafter, referred to as a “correction process B”). A desired disparity image is calculated by comparing pixel values configuring the generated image C1 (S (1)) and the image C′(1′) (S′(1′)).
Further, Non-Patent Literature 1 discloses a dense disparity image calculating technique based on an SGM technique that is an in-vehicle high-functioning stereo camera technique as a basic technique of the technique disclosed in Patent Literature 1. In the technique disclosed in Non-Patent Literature 1, a disparity image D is acquired by a stereo camera, and a desired disparity image is calculated by correcting disparity values of pixels configuring the disparity image D based on disparity values of some pixels in pixel routes in at least eight directions with respect to the same pixel. Furthermore, Non-Patent Literature 2 discloses the SGM technique as well.